package com.luoye.lj.platform.model;

import com.luoye.lj.platform.model.domain.muser.MUserDetail;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

public class UserModel extends User {

    private MUserDetail mUserDetail;
    private long userId;

    public UserModel(String username, String password, Collection<? extends GrantedAuthority> authorities, MUserDetail mUserDetail) {
        super(username, password, authorities);
        this.userId=mUserDetail.getId();
        this.mUserDetail=mUserDetail;
    }

    public MUserDetail getmUserDetail() {
        return this.mUserDetail;
    }

    public void setmUserDetail(MUserDetail mUserDetail) {
        this.userId = mUserDetail.getId();
        this.mUserDetail=mUserDetail;
    }

    @Override
    public String toString() {
        return "UserModel{" +
                "userId=" + userId +
                '}';
    }
}
